import request from '../utils/request'

//所有商品接口在这里面管理

export class Orders {
    //订单列表
    static getlist = () => request({
        url: '/order/list',
        method: 'get'
    })
    //添加订单或选购结算
    static add = (userid, addr, orderinfo, ordernumber, totalfee) => request({
        url: '/order/add',
        method: 'post',
        data: {
            userid,
            addr,
            orderinfo,
            ordernumber,
            totalfee
        }
    })
    //删除订单
    static del = (orderid) => request({
        url: '/order/delete',
        method: 'post',
        data: {
            orderid: orderid
        }
    })
    //查询订单
    static select = (num) => request({
        url: '/order/select',
        method: 'post',
        data: {
            ordernumber: num
        }
    })
    //分页
    static fenye = (currentPage4, limit) => request({
        url: '/order/orderlist',
        method: 'get',
        params: {
            pageNum: currentPage4,
            limit: limit,
        }
    })
    //状态
    static zhuangtai = (ordernum) => request({
        url: '/order/status',
        method: 'post',
        data: {
            ordernumber: ordernum
        }
    })
}